#define _CRT_SECURE_NO_WARNINGS
#include <cctype>
#include <iostream>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
struct comp {
    bool operator()(const pair<string, int>& p1, const pair<string, int>& p2) {
        return ((p1.second > p2.second) || (p1.second == p2.second &&
            p1.first < p2.first));
    }
};
int main() {
    string s1;
    getline(cin, s1);
    map<string, int> mp;
    string tmp;
    for (auto& e : s1) {
        if (isupper(e))
            e = tolower(e);
        if (e != ' ' && e != '.')
            tmp += e;
        if (e == ' ' || e == '.') {
            mp[tmp]++;
            tmp.clear();
        }
    }
    vector<pair<string, int>> v(mp.begin(), mp.end());
    sort(v.begin(), v.end(), comp());
    auto it = v.begin();
    while (it != v.end()) {
        cout << it->first << ":" << it->second << endl;
        it++;
    }
    return 0;

}